package com.jinlingxiu.app.other.ext

import android.view.View
import com.jakewharton.rxbinding4.view.clicks
import com.xdja.easymvp.utils.onClick
import java.util.concurrent.TimeUnit

fun View.setNoDoubleClick(method: () -> Unit) {
    this.clicks()
        .throttleFirst(200, TimeUnit.MILLISECONDS)
        .subscribe {
            onClick { method() }
        }
}